UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '435nxvhPBn3Qr/HXbeENwux+0HFOQQ9M5lyT9Gukdmg='
WHERE
key_id = '6df3f400145c973cca3258a7889db5ec4637a0a31e0cf5f242cc9600731175ae'
AND (
token = '435nxvhPBn3Qr/HXbeENwux+0HFOQQ9M5lyT9Gukdmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)