UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PU4QFSDpPIr/KZm61Sf/H4Fri8i1RrP5SylsB0iSu/g='
WHERE
key_id = 'b92d91dc8829740f70621f7f315f1d3abd923feddbedf2683e8139f1e2067f47'
AND (
token = 'PU4QFSDpPIr/KZm61Sf/H4Fri8i1RrP5SylsB0iSu/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)