UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '89ic/ilv5UOt66uq+XPaS/PbRhG7RRKL7ZaqFhAceAE=' 
WHERE 
  key_id = '76ceb4dba6486bbf4fd7e08697a32ed5005b8295885b2b844f5a83972e6d80af' 
  AND (
    token = '89ic/ilv5UOt66uq+XPaS/PbRhG7RRKL7ZaqFhAceAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026