UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FGCc7Czp0ARrlvqo/TKcy6jmPTqzb8MJsxjxaWx4nX8=' 
WHERE 
  key_id = 'b7b9bc9bd1bc0a72c2e47b993e2aa8095bb45c8890851a80dbd095491ae49351' 
  AND (
    token = 'FGCc7Czp0ARrlvqo/TKcy6jmPTqzb8MJsxjxaWx4nX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00197