UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GsTxkUkUuHY10UenJf9kXrPQZ/qpCJzXyvzfaB0eGYE=' 
WHERE 
  key_id = 'a3481f45a36acd8e4f8ccf904884715d6020f9a0c6507b68ca782f133fa2f6cf' 
  AND (
    token = 'GsTxkUkUuHY10UenJf9kXrPQZ/qpCJzXyvzfaB0eGYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032