UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3rskqjPnq6QRReKU+Sl/NaIcD7qqI1Kl0wO+zDrNpvg='
WHERE
key_id = '350887d02f944b1cabeeda6719f384388650fa9116d4e4ef6d86270e53864c57'
AND (
token = '3rskqjPnq6QRReKU+Sl/NaIcD7qqI1Kl0wO+zDrNpvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)