UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/QcXCnNDQpZi2vK97BSNUQTGNr28+mWWJ3sAozJ4n24='
WHERE
key_id = '7b87d668969322bde69d5d17d9a4376b1671e96b90e0dc9122087c68526ed0f4'
AND (
token = '/QcXCnNDQpZi2vK97BSNUQTGNr28+mWWJ3sAozJ4n24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)