UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SgplOAF54zlOKR3EiniW307cTsOlNp8o5RC2dhE1yxo=' 
WHERE 
  key_id = '9e8a458f3c27724d53128f5c6228d64fe3b51e5799cf8ec15fdd78846632edfd' 
  AND (
    token = 'SgplOAF54zlOKR3EiniW307cTsOlNp8o5RC2dhE1yxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017