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

Query time 0.00032