UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '73MUHTz6r8NMVJEZvUK/r1k2Sn/b/AEDFYVRhFYw6oI='
WHERE
key_id = '7a390f7be880d0d7045d369080503e33a6486e656a591d637b13ca14a2c10869'
AND (
token = '73MUHTz6r8NMVJEZvUK/r1k2Sn/b/AEDFYVRhFYw6oI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)