UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rvIsmD7XR6rYhybL6/e4x2Md8hyMzrC560M3c/Zud0c='
WHERE
key_id = 'da5949c9d064d2cbda11d9dc9385f4446e427b3994ff218b3fee53743b1ee004'
AND (
token = 'rvIsmD7XR6rYhybL6/e4x2Md8hyMzrC560M3c/Zud0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)