UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBdawwMSeURrNfN9cExwUql7txyqIBSKoEQXs8u3yXM='
WHERE
key_id = '7e64684171d26e0691ec828368dd1104227791ff25bcee28be6af0ad43f37873'
AND (
token = 'WBdawwMSeURrNfN9cExwUql7txyqIBSKoEQXs8u3yXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)