UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QSZW2n+MY+fl4EiL5jnhv/asETz3DaBotDGLHuqVwnY='
WHERE
key_id = '6515cea0f70dde7edc3377c5673e23c0c1dc7f0ee582f7454b617d0e2bbadade'
AND (
token = 'QSZW2n+MY+fl4EiL5jnhv/asETz3DaBotDGLHuqVwnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)