UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/nU50KIAScJNsStFOALXXZy3LPLmLt50vCg5BZkhN1c=' 
WHERE 
  key_id = '0efd77b8cc67cc02b54bc301e3b53a97a630eef8fb264840bc2ab09b5d414407' 
  AND (
    token = '/nU50KIAScJNsStFOALXXZy3LPLmLt50vCg5BZkhN1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022