UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9EgqIMDKHRZ51z8LvCnzvfw4y4LWzL6GjgJwzvBvR5E='
WHERE
key_id = '38875a780fa17472946e7d442d69da302683427e105e4fb29c6c41d8fe09722a'
AND (
token = '9EgqIMDKHRZ51z8LvCnzvfw4y4LWzL6GjgJwzvBvR5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)