UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gMVj3dxcYIE2JHUY/39Fd0Ay1lgEAXE+QjGPsm5ITDk='
WHERE
key_id = 'e3a6f679c49c263210a7c80d06dc875cb41b3fe7c3e157a9d768bd5857fb618d'
AND (
token = 'gMVj3dxcYIE2JHUY/39Fd0Ay1lgEAXE+QjGPsm5ITDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)