UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oHAfu7xPVQg8QFXr1A1tkeV0PQ0hY+Vnd3yHcpNEvNA='
WHERE
key_id = '1e83373dcbc528040ab2e0069cffe93f9389d912aa9e25629d1d82bde5611fb8'
AND (
token = 'oHAfu7xPVQg8QFXr1A1tkeV0PQ0hY+Vnd3yHcpNEvNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)