UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awwCUAmo2oIB6YdUz/uimucdnes8rGIVfi2Q2i3hxxQ='
WHERE
key_id = '2ee59e2378886ce42356c01dc70f068b324ad0a08055feb5d985edf36b4d800e'
AND (
token = 'awwCUAmo2oIB6YdUz/uimucdnes8rGIVfi2Q2i3hxxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)