UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ct0MHSNY2EiRSOB48WefkJttz7KfoxiKe0O0LfaQZMk='
WHERE
key_id = '4222a5feb512efb5e8e354dea0763a0ac86d1a37d3ccb85f2ef192cdff9149fe'
AND (
token = 'ct0MHSNY2EiRSOB48WefkJttz7KfoxiKe0O0LfaQZMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)