UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hedoCEcI7ihh0SH7qW3xE71RKnOB1NYUVo67l6KtbPM='
WHERE
key_id = 'f12fcf4717dcf3dc4a4bb28b7e56f520a11db0579fe03f5f95b07de8f51cf6fb'
AND (
token = 'hedoCEcI7ihh0SH7qW3xE71RKnOB1NYUVo67l6KtbPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)