UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OLrNVqOVxEHpjfWL40Hz/tf2qk4uHxJQC0fJ+GdNx9U=' 
WHERE 
  key_id = '7d073b1059bbc4d4befc0ddd4676d04f2c767b3c2df34f11c9b14fe2924b19a1' 
  AND (
    token = 'OLrNVqOVxEHpjfWL40Hz/tf2qk4uHxJQC0fJ+GdNx9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030