UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qneAB4Pf30AF1GsgTF9Z55lPpbID0vF2lLNPT0KUWHk=' 
WHERE 
  key_id = 'd1b05eefd4bdc263dcd737078ab642dc85a8a2c5bd7ad386c4f618845754c918' 
  AND (
    token = 'qneAB4Pf30AF1GsgTF9Z55lPpbID0vF2lLNPT0KUWHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027