UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LH3izHxCrBCkPLN2F4MHjkU4m4o4BaNxHVmxDwiwKT0='
WHERE
key_id = 'b8d8c9ca69d54781d59f6e51305014ad419fe8a0bf387394cbfcb3a5a868ad8e'
AND (
token = 'LH3izHxCrBCkPLN2F4MHjkU4m4o4BaNxHVmxDwiwKT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)