UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G4BS1VBAPzruO4BqM24SZZ+so7nrPPxOq7zWfXKSU/w=' 
WHERE 
  key_id = '3bec3823373fec486b8dad0d149b3374b2b8678e4950168ba09bec60cc8c4155' 
  AND (
    token = 'G4BS1VBAPzruO4BqM24SZZ+so7nrPPxOq7zWfXKSU/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029