UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sIhK3nJKJD/BOU5BPtn/7wz7GerOR4spHGWX7J/XEk='
WHERE
key_id = '286d7bf82c3656e85827591a6a1a97a78a7f8059f790d938e3b3e5c7364430fc'
AND (
token = '/sIhK3nJKJD/BOU5BPtn/7wz7GerOR4spHGWX7J/XEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)