UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mEYx7EEBT44kj/1Y7PfGWXwV99d8roSyy2eNkgMj0LE='
WHERE
key_id = '7d56e928c1393f2ba54934fbb859df578e7ca0e1b33f4abf74c87e74aebe28f7'
AND (
token = 'mEYx7EEBT44kj/1Y7PfGWXwV99d8roSyy2eNkgMj0LE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)