UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NAB+xFZgCnn9UdHz+K46Gylp2Ho0X7P+d2BcvQeffGQ='
WHERE
key_id = '02d2745e41e65b0ef69a5cbeb5f73db010dd0176f267f98b9afae85c1cfb28a5'
AND (
token = 'NAB+xFZgCnn9UdHz+K46Gylp2Ho0X7P+d2BcvQeffGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)