UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gZz7XxMWUD/SqJJ5gWGcWJIrlOV4zfK+Wi9ZI0edeQU=' 
WHERE 
  key_id = '009baec027eb0332d860ccc75d1d636ad05aba45ad943dc9a35fe3f63c6fb253' 
  AND (
    token = 'gZz7XxMWUD/SqJJ5gWGcWJIrlOV4zfK+Wi9ZI0edeQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027