UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pqTiapDV8yQZ/+aJHu1/NatBu5pj1nWSC574cCDrago='
WHERE
key_id = 'ca37d62b1bf6b3fbb4a82990db57128ee2144e6e9f1d8fa9fd4ebddb7a66b856'
AND (
token = 'pqTiapDV8yQZ/+aJHu1/NatBu5pj1nWSC574cCDrago='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)