UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0kioWQt+j5Ywb0E87LcXV2MPAMoFdQnvCLitJKwrArg=' 
WHERE 
  key_id = '33f56178910bfb88c90f08f7c413310b62defacdc0a420f37536e6c70742456e' 
  AND (
    token = '0kioWQt+j5Ywb0E87LcXV2MPAMoFdQnvCLitJKwrArg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028