UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RTCvayKRAAjAQQ9zJAOf6CA/bpeDo+ov26fo9lgR+1s='
WHERE
key_id = '8b2ab9f256e2890685cf59bd007ba98cb87e9c63379fde9687379c8206b0aea0'
AND (
token = 'RTCvayKRAAjAQQ9zJAOf6CA/bpeDo+ov26fo9lgR+1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)