UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S+VhXMveCzPbwe2QGeLOROe2hL7tltwOvSL3xzS0OZs='
WHERE
key_id = '2bfbb180c944386b9c2dc772efa58c52f2a4fb7197fdaab9c11b3e6cd50b94b2'
AND (
token = 'S+VhXMveCzPbwe2QGeLOROe2hL7tltwOvSL3xzS0OZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)