UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J7TxoXAPPiFMqXENfwJWSaHvmlBQRVy389Vbu2WL9j4=' 
WHERE 
  key_id = '42652c9f69634b916fa04e7935c95085aeb712ae5dc5ba02dffbebee02d69b29' 
  AND (
    token = 'J7TxoXAPPiFMqXENfwJWSaHvmlBQRVy389Vbu2WL9j4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021