UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RMMHVaYC2Gj5zdlCvUfiy8cFME2aJWDgy5O1egnvjYM='
WHERE
key_id = '0dfb588e3f8c609797aaa5ce0c8c6f762674862537d3379c985f3d450ca0f88f'
AND (
token = 'RMMHVaYC2Gj5zdlCvUfiy8cFME2aJWDgy5O1egnvjYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)