UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GMalmkYvhKcGFFcNUhYu6ki6+ZH3KcxhyDBeUkOVfLw=' 
WHERE 
  key_id = 'c1dac1d3f3d6749b649a89d914cfe0d00c5431f60a85536bf900787c09eba34c' 
  AND (
    token = 'GMalmkYvhKcGFFcNUhYu6ki6+ZH3KcxhyDBeUkOVfLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033