UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ClbgSA8/iRq4lzlHEYTJClwahLyEc9TLA/zs2ilotcQ=' 
WHERE 
  key_id = '4ae552e1a3f40ea39def1327b1baa528aa6dc372944afda594382a7af5e7a60b' 
  AND (
    token = 'ClbgSA8/iRq4lzlHEYTJClwahLyEc9TLA/zs2ilotcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030