UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y1vbgh/snX/JKS2sX0CqlKd525RFg6wLHxTd0Zkp49c=' 
WHERE 
  key_id = '0f74c8390ca1d657046794fec669db39f9823abc6e246f4dc740aa8bc4d790b8' 
  AND (
    token = 'y1vbgh/snX/JKS2sX0CqlKd525RFg6wLHxTd0Zkp49c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061