UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kGOG3TMoOYdnZSd6XDYrp/NUvPyfUYCzYWgxQPZTcU4=' 
WHERE 
  key_id = 'fb5e4f0891d4943c5cfd6cffdb821449d1938f950fc54286df3fe8bcf7c9446f' 
  AND (
    token = 'kGOG3TMoOYdnZSd6XDYrp/NUvPyfUYCzYWgxQPZTcU4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022