UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/jX/fvzW56gDfFqSxYu9NATS4A37SvRqb2DhWHFIZo0='
WHERE
key_id = '27cd4fc86f788c034e7788f131cf169e3b731905073f1018c77a4c8b162d1119'
AND (
token = '/jX/fvzW56gDfFqSxYu9NATS4A37SvRqb2DhWHFIZo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)