UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QGtyEh/nxy2QExXCBZmJao78BD8c1wFmKDs9T0U0KiE='
WHERE
key_id = '796d694cc0d3e65d61b3fc8acc330a22f664781d69fe98ee2868c1c437fdabf4'
AND (
token = 'QGtyEh/nxy2QExXCBZmJao78BD8c1wFmKDs9T0U0KiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)