UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qt5P0chLn/jaK1v/iYtv75+B0BwVTFG31s4VQOwlzcE='
WHERE
key_id = 'b92cd5bbf667998e5e754db98676d6e7c648f7478c013e370370b6efd47d6cd0'
AND (
token = 'qt5P0chLn/jaK1v/iYtv75+B0BwVTFG31s4VQOwlzcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)