UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '33IvzxTzLaURGaASqKoFECvzj7NsqCPzHY1MzUvK1ms='
WHERE
key_id = '7a3518bbce96814581ef5f2fec7f9ebd9f6b94946b239799563d333fd30a363a'
AND (
token = '33IvzxTzLaURGaASqKoFECvzj7NsqCPzHY1MzUvK1ms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)