UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qq4aOdrzSYiDopmiJfz+FG2JHHWBsL10xL/W0OVgtk0='
WHERE
key_id = '4060f07e57622d366c436b401c9988e1ec349542b35b6f0277f0111f477330bb'
AND (
token = 'qq4aOdrzSYiDopmiJfz+FG2JHHWBsL10xL/W0OVgtk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)