UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G9HF7V7RE6EEylnlViJcpTxoGcRGyMJ1YwgcOtae55E=' 
WHERE 
  key_id = '092dd8c79c72221292fbd19d437346219e7d6a65c4159196773ccab0797e5a36' 
  AND (
    token = 'G9HF7V7RE6EEylnlViJcpTxoGcRGyMJ1YwgcOtae55E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038