UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '879PZHDV65r4L9qpmrgQrQ4IJU7dcl8z/Fg6zLTSPRc=' 
WHERE 
  key_id = '5c5b215c621d7113b45259347726186650c220a99a1f52c410055d8a1285b9bb' 
  AND (
    token = '879PZHDV65r4L9qpmrgQrQ4IJU7dcl8z/Fg6zLTSPRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028