UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GzTtd8d1c/mASrDbdnUNrfPF0TLOiIip4Qe5Yk8imUs='
WHERE
key_id = '0ac2d08aa225173a2c7bafb9870e5297285be6f9f3938a31cb29be8fc12f5460'
AND (
token = 'GzTtd8d1c/mASrDbdnUNrfPF0TLOiIip4Qe5Yk8imUs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)