UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWAaye9+mqG+4h2Spu/KT0RZGGC5m4XY7YgkaxT3pXY='
WHERE
key_id = 'b4396fd5f453a6fd41d638ef47a62a5e07c2da414776891ed6ebae31abbd117d'
AND (
token = 'ZWAaye9+mqG+4h2Spu/KT0RZGGC5m4XY7YgkaxT3pXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)