UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ye/K0GrKZRTRDFVTFUJvzJxxvIpZNZOZkUstwAC6X8I='
WHERE
key_id = '5d7ad09071a18fe6aea38ea588ea465b2ef7c3b98625d9e8a538fe99be4c3e7a'
AND (
token = 'Ye/K0GrKZRTRDFVTFUJvzJxxvIpZNZOZkUstwAC6X8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)