UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j18nISrlWup8ch2N3dCSU1LbzAGlPY+eiKCxZ3JLbxY='
WHERE
key_id = '8b0f545d82e7fb0ce1fb781e4f707ef2233df838f7b850e93b7b8762ce3c25fd'
AND (
token = 'j18nISrlWup8ch2N3dCSU1LbzAGlPY+eiKCxZ3JLbxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)