UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MRmPnjExe9gFnc9H/Qqba/k7aBIzdyeKkXHcHCRK/Kg='
WHERE
key_id = '5dddd7adb87fc5343fea20a4606bdf1e6ad0d4611310380da35edc8f24140009'
AND (
token = 'MRmPnjExe9gFnc9H/Qqba/k7aBIzdyeKkXHcHCRK/Kg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)