UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bH8gJ+0sXUeD4IfyebOGPu/woR1gR2mmMb/08TPGqWY='
WHERE
key_id = '6ce1b55b9d117bc1feb2831e423a49dea782c7957fd225f48c6baf710123fca0'
AND (
token = 'bH8gJ+0sXUeD4IfyebOGPu/woR1gR2mmMb/08TPGqWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)