UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ovw1NppssWkHIcEvSaA/vfqj/1VjoMzl2YVwvIbZa8=' 
WHERE 
  key_id = 'f9b68ed7aec89fc4d3435b60e793b7e9336fa73fc102edff1eb90e06730e7ac1' 
  AND (
    token = '1ovw1NppssWkHIcEvSaA/vfqj/1VjoMzl2YVwvIbZa8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024